package io.finer.erp.jeecg.purchase.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.finer.erp.jeecg.approve.entity.ApproveRecord;
import io.finer.erp.jeecg.purchase.entity.PurchaseOrder;
import com.baomidou.mybatisplus.extension.service.IService;
import io.finer.erp.jeecg.purchase.entity.PurchaseOrderLine;
import io.finer.erp.jeecg.purchase.entity.PurchaseRequest;
import io.finer.erp.jeecg.purchase.entity.PurchaseRequestLine;
import io.finer.erp.jeecg.purchase.vo.PurchaseOrderPage;
import io.finer.erp.jeecg.stock.entity.StockMove;
import io.finer.erp.jeecg.stock.vo.StockMovePage;
import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 采购订单 服务类
 * </p>
 *
 * @author yaoyifan
 * @since 2021-06-15
 */
public interface PurchaseOrderService extends IService<PurchaseOrder> {
    public void saveMain(PurchaseOrder purchaseOrder, List<PurchaseOrderLine> purchaseOrderLineList);
    public IPage<PurchaseOrderPage> selectPurchaseOrderPage(Page page, @Param(Constants.WRAPPER) Wrapper<PurchaseOrderPage> queryWrapper);
    public PurchaseOrderPage selectPurchaseOrderPageById(@Param("id") String id);
    public void delMain(String id);
    public void delBatchMain(Collection<? extends Serializable> idList);
    public void updateMain(PurchaseOrder purchaseOrder, List<PurchaseOrderLine> purchaseOrderLineList);
    public void submit(String model, String id);
    public String approve(String model, String id, String note);
    public void reject(String model, String id, String note);
    public boolean canApproveorReject(String model, String id);
    public Map<String, Boolean> canSubmitorWithdraworInvalid(String model, String id, IService<PurchaseOrder> service);
    public List<ApproveRecord> queryApproveRecordList(String model, String id);
    public void withDraw(String model, String id);
    public void invalid(String id, String note);
    public void createStockMove(String id);
    public void updateState(String billNo);
}
